from django.conf.urls.defaults import *

urlpatterns = patterns('inventory.views',
    # Example:
    # (r'^sniffbook/', include('sniffbook.foo.urls')),

    # Root goes to materials list
    (r'^$', 'accordlist', {'show_all':True}),

    # List view:
    # TODO: how to combine these?
    (r'^list/$', 'accordlist'),
    (r'^list/s=(?P<sort_field>.*)$', 'accordlist'),
    (r'^list/m=(?P<message>.*)$', 'accordlist'),

    (r'^accords/$', 'accordlist', {'show_all':False}),

    # Material detail:
    (r'^material/(?P<mat_id>\d+)/$', 'material'),
    (r'^material/(?P<mat_id>\d+)/delete/$',
     'material', {'delete_me':True}),

    # Rendered:
    (r'^render/(?P<mat_id>\d+)/$', 'render'),
    (r'^render/(?P<mat_id>\d+)/s=(?P<sort_key>.*)$',
     'render'),

    # Search:
    (r'^search$', 'search'),

    # Import:
    (r'^import-export$', 'import_export'),
    (r'^import$', 'import_export', {'action':'import'}),
    (r'^export/(?P<export_type>\w+)/$', 'export')

    # Uncomment the admin/doc line below and add 'django.contrib.admindocs' 
    # to INSTALLED_APPS to enable admin documentation:
    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    # (r'^admin/', include(admin.site.urls)),
)
